package com.code.day03;

import com.code.utils.JDBCUtils;
import org.junit.Test;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo02JDBC {

    @Test
    public void insert() throws SQLException {
        JDBCUtils jdbcUtils=new JDBCUtils();
        Connection conn=jdbcUtils.getConnection();

        Statement stmt = conn.createStatement();
        int row = stmt.executeUpdate("insert into t_user (username,password) values ('jerry','222');");
        System.out.println(row);

        JDBCUtils.closeConnection(conn,stmt,null);
    }
}
